<template>
  <div>
    <div>count:{{ $store?.state?.count }}</div>
    <div><button @click="handleCount">点击增加count</button></div>
    <div>num:{{ $store?.state?.my?.num }}</div>
    <div><button @click="handleNum">点击增加num</button></div>
  </div>
</template>
<script>
export default {
  created() {
    console.log(this.$store)
  },
  methods: {
    handleCount() {
      this.$store.dispatch('add', 1)
    },
    handleNum() {
      this.$store.dispatch('/my/add', 2)
    }
  }
}
</script>
